import React from 'react';
import PropTypes from 'prop-types';
import DefaultModalMsg from '@welab/fx-ui/components/ModalMsg';
// import fn from '@welab/fx-ui/components/PlateformHalf';
import SystemIcon from './SystemIcon';
import { modal } from '../theme';

const ModalMsg = ({
  children, ...rest
}) => (<DefaultModalMsg {...rest} iconComponent={SystemIcon} >{children}</DefaultModalMsg>);

ModalMsg.defaultProps = {
  desc: '',
  children: null,
  onClose: null,
  theme: modal.modelTheme,
};
ModalMsg.propTypes = {
  /**
   * ### ModalMsg 属性说明
   *
   * 模态弹框(有信息发送的)
   *
   * | Name | Type | Default | Details | isRequired |
   * | ------:| -----------:| -----------: | -----------: | ------:|
   * | theme | object | | 主题 | no|
   * | phoneNum | string | | 电话号码 |yes|
   * | desc | string | | 描述文字 |no|
   * | onClose | function | | 关闭事件 |no|
   * | children | object | | 子元素(按钮) |no|
   *
   * ### ModalMsg 代码示例(详见示例项目)
   *
   * ```html
   * <ModalMsg theme={ModalMsg} desc="描述文字"><Button>primary</Button></ModalMsg>
   * ```
   */
  theme: PropTypes.instanceOf(Object),
  phoneNum: PropTypes.string.isRequired,
  desc: PropTypes.string,
  children: PropTypes.instanceOf(Object),
  onClose: PropTypes.func,
};

export default ModalMsg;
